home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Window / c / GetInfo < prev    next >
Text File  |  1995-09-02  |  2KB  |  47 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Window.GetInfo.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (19 Mar 1992)
  14.     Purpose: High-level window management functions: Get Window info
  15. */
  16.  
  17.  
  18.  
  19. #include <string.h>
  20.  
  21. #include "DeskLib:WimpSWIs.h"
  22. #include "DeskLib:Window.h"
  23.  
  24.  
  25. extern void Window_GetInfo(window_handle window, window_info *result)
  26. /* Returns just the window part of the window_info block (strips icon defn.s)
  27.  * The real solution would be to find out how many icons were in the window
  28.  * and then get a flex block big enough for the whole thing and then do it,
  29.  * but you can't read the number of icons until you have read the window_info
  30.  * so it's a bit difficult! As a result, I just use a 4kB block to hold
  31.  * the window definition in.
  32.  *
  33.  *      NOTE THAT THIS WILL CRASH IF A WINDOW HAS TOO MANY ICONS!!!!!
  34.  *      (anything more than about 120 icons will cause undefined results)
  35.  *
  36.  * SeeAlso: Window_GetInfo3()
  37.  */
  38. {
  39.  
  40.   int         block[1024];           /* 4096 bytes for winfo return block */
  41.   window_info *winfo = (window_info *) &block[0];
  42.  
  43.   winfo->window = window;
  44.   Wimp_GetWindowInfo(winfo);
  45.   memcpy(result, winfo, sizeof(window_info));
  46. }
  47.